package com.example.zzbus.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.BottomNavigationView;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.zzbus.R;
import com.example.zzbus.base.MapBase;
import com.example.zzbus.data.UserData;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MeActivity extends MapBase {

    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.tv_nick)
    TextView tvNick;
    @Bind(R.id.tv_phone)
    TextView tvPhone;
    @Bind(R.id.btn_outlogin)
    Button btnOut;
    @Bind(R.id.nav_view)
    BottomNavigationView navView;
    @Bind(R.id.rela_order)
    RelativeLayout relaOrder;
    @Bind(R.id.activity_setting)
    LinearLayout activitySetting;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_me);
        ButterKnife.bind(this);
        iniBar(2);
        tvTitle.setText("" + UserData.getSpString(UserData.sp_userName));
        tvNick.setText("" + UserData.getSpString(UserData.sp_userNick));
        tvPhone.setText("" + UserData.getSpString(UserData.sp_userPhone));
    }


    @OnClick({R.id.rela_order, R.id.btn_outlogin})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rela_order:
                startActivity(new Intent(this,OrderActivity.class));
                break;
            case R.id.btn_outlogin:
                UserData.setBoolData(false);
                startActivity(new Intent(MeActivity.this,LoginActivity.class));
                finish();
                break;
        }
    }
}
